<template>
	<view>
		<block v-for="(item,index) in dataList" :key="index">
		<view class="notice_list" :data-url="'/pages/notice/noticecontent?id='+item.id" @click="gotopage">
		
			<view class="icon iconfont" v-if="type==13">&#xe6df;</view> 
				<view class="icon iconfont" v-else>&#xe619;</view>
		<view class="title" style="height: 100%;display: flex;align-items: center;">{{item.title}}</view>
	<!-- 	<view class="time">{{item.date}}</view> -->
			<view class="arrow iconfont">&#xe775;</view>
		</view>
	</block>
	</view>
</template>

<script>
	export default {
		data() {
			return {
dataList:'',
type:0
			}
		},
		onLoad(e) {
			
				let me = this;
				me.type=e.type;
				me.Net._get('activity',{type:e.type},res=>{
					me.dataList = res.data;
				});
			
		},
		onShareAppMessage(res) {
			console.log('分享', res);
		
			return {
				title: '汉家承',
				path: "/pages/news/news",
				imageUrl: '',
				desc: '',
				content: '',
				success(res) {
					uni.showToast({
						title: '分享成功'
					});
				},
				fail(res) {
					uni.showToast({
						title: '分享失败',
						icon: 'none'
					});
				}
			};
		},
		onShareTimeline(res) {
			console.log('分享', res);
		
			return {
				title: '汉家承',
			    path: "/pages/news/news",
				imageUrl: '',
				desc: ' ',
				content: ' ',
				success(res) {
					uni.showToast({
						title: '分享成功'
					});
				},
				fail(res) {
					uni.showToast({
						title: '分享失败',
						icon: 'none'
					});
				}
			};
		},
		methods: {
			gotopage(e){
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #f8f8f8;
		
	}
	
	.notice_list {
		width: 90%;
		height: 70px;
		background-color: #fff;
		border-radius: 6px;
		margin: 0 auto;
		margin-top: 10px;
		position: relative;
	}
	
	.notice_list .icon {
		width: 50px;
		height: 50px;
		border-radius: 50%;
		position: absolute;
		left: 10px;
		top: 10px;
		background-color: #f2f8f9;
		font-size: 26px;
		color: #ff907c;
		line-height: 50px;
		text-align: center;
	}
	
	.notice_list .title {
		font-size: 14px;
		color: #333;
		font-weight: bold;
		position: absolute;
		top: 0;
		left: 70px;
		width: calc(100% - 106px);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	
	.notice_list .arrow {
		font-size: 16px;
		color: #999;
		position: absolute;
		right: 10px;
		top: 0;
		height: 70px;
		line-height: 70px;
	}
	
	.notice_list .time {
		font-size: 12px;
		color: #999;
		position: absolute;
		left: 70px;
		bottom: 10px;
	}
</style>
